package com.ylfstu.map_;

import java.util.Hashtable;
@SuppressWarnings({"all"})
public class HashTableSource {
    public static void main(String[] args) {

        Hashtable hashtable = new Hashtable();
        hashtable.put("john", 100);
        hashtable.put("lucy", 100);
        hashtable.put("ylf1", 100);
        hashtable.put("ylf2", 88);
        hashtable.put("abc1", 11);
        hashtable.put("abc2", 11);
        hashtable.put("abc3", 11);
        hashtable.put("abc4", 11);
        hashtable.put("abc5", 11);
        hashtable.put("abc6", 11);
        System.out.println(hashtable);

        //1.底层有数组 HashTable$Entry[] 初始化大小为11
        //2.临界值 throshold 8 = 11 * 0.75
        //3.扩容
        //4.执行 方法addEntry(hash, key, value, index);添加k-v 封装到Entry
        //5. 当 if (count >= threshold) 满足时，就进行扩容
        //6. 按照 int newCapacity = (oldCapacity << 1) + 1; 大小扩容
    }
}
